package com.light.sword.concurrent

import java.util.concurrent.locks.ReentrantLock

class ReentrantLockDemo {
    private val lock = ReentrantLock()

    fun lockTest() {
        lock.lock()

        try {
            // ... method body
            for (i in 0..10)
                println("LOCK")

        } finally {
            lock.unlock()
        }
    }

}


fun main(args: Array<String>) {
    val d = ReentrantLockDemo()
    d.lockTest()
}
